<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <f:view contentType="text/html">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Finantial Faces</title>
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/themes/#{themeService.theme}/skin.css" />
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/global.css" />
        <f:loadBundle  basename="br.rmpestano.finantial.bundle.MessageResource_#{i18nService.currentResourceBundle}" var="msg"/>
        #{browserService.noCache()}

        <ui:insert name="head"/>
       
    </h:head>
        
       <h:body>
           <ui:param name="menuY" value="#{(browserService.currentBrowser eq browserService.CHROME) or (browserService.currentBrowser eq browserService.SAFARI) ? '27':'32'}"/>
      <h:form id="theme_form" >
          <p:menu widgetVar="themeMenu" position="dynamic" y="#{menuY}" x="2"  styleClass="themeMenu" >
                            <p:submenu label="Themes">
                                <p:menuitem value="Aristo" immediate="true" ajax="false" action="#{themeService.aristoInit}" style="#{themeService.theme eq 'aristo' ? 'color:black;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Bluesky" immediate="true" ajax="false" action="#{themeService.blueSkyInit}" style="#{themeService.theme eq 'bluesky' ? 'background-color:#DFEDFF;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Casablanca" immediate="true" ajax="false" action="#{themeService.casablancaInit}" style="#{themeService.theme eq 'casablanca' ? 'color:red;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Cupertino" ajax="false"  action="#{themeService.cupertinoInit}" immediate="true" style="#{themeService.theme eq 'cupertino' ? 'background-color:#62BBE8;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Dark-Sky" ajax="false" immediate="true" action="#{themeService.darkSkyInit}" style="#{themeService.theme eq 'dark-sky' ? 'color:#0D31BA;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Dot-Luv" immediate="true" ajax="false" action="#{themeService.dotLuvInit}" style="#{themeService.theme eq 'dot-luv' ? 'color:#1A558F;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Overcast" ajax="false" immediate="true" action="#{themeService.overcastInit}" style="#{themeService.theme eq 'overcast' ? 'color:red;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Mint-Choc" ajax="false" action="#{themeService.mintChocInit}" immediate="true" style="#{themeService.theme eq 'mint-choc' ? 'color:#99EC7E;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Pepper-Grinder" ajax="false" immediate="true" action="#{themeService.pepperInit}" style="#{themeService.theme eq 'pepper-grinder' ? 'background-color:#674F2C;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Ui-Darkness" ajax="false" immediate="true" action="#{themeService.uiDarknessInit}" style="#{themeService.theme eq 'ui-darkness' ? 'color:#F58400;font-weight:bolder;text-decoration:underline':''}"/>
                                <p:menuitem value="Vader" ajax="false"  action="#{themeService.vaderInit}" immediate="true" style="#{themeService.theme eq 'vader' ? 'color:red;font-weight:bolder;text-decoration:underline':''}"/>
                            </p:submenu>
                       </p:menu>

              <p:ajaxStatus style="z-index: 9999;left:87%;top:10%;position: absolute">
                                        <f:facet name="start">
                                            <h:graphicImage library="images" name="#{themeService.themeProperties.LOADING_ICON eq '' ? 'ajax-loader-red.gif' : themeService.themeProperties.LOADING_ICON}"/>
                                        </f:facet>

                                        <f:facet name="complete">
                                            <h:outputText value="" />
                                        </f:facet>
                                    </p:ajaxStatus>
          
          <h:panelGroup id="group" layout="block" style="margin-top: -7px;display:inline-table;width: 100%;">
                          <p:commandButton id="themeButton" value="#{msg['themechange']}" onclick="themeMenu.show()" type="button" style="width: 130px"/>
                          <p:commandButton id="configButton" rendered="#{menu == 1 and conf == 1}" value="#{msg['config']}" ajax="false"  action="config" update="messages" style="width: 145px"/>
                          <p:commandButton id="financeButton" rendered="#{menu == 1 and finance == 1}" value="#{msg['finance']}" ajax="false" title="#{msg['finance-tip']}"  action="/pages/home.faces?faces-redirect=true" style="width: 125px"/>
                          <p:commandButton id="adminButton" rendered="#{loginBean.admin and admin == 1}" action="admin" value="#{msg['admin']}" ajax="false" style="width: 145px"/>
                          <p:outputPanel rendered="#{menu == 1}">
                              <div style="position: relative;float: right">
                                  <p:commandButton id="logoutButton" value="#{msg['logout']}" ajax="false" immediate="true" actionListener="#{loginBean.doLogout}"/>
                              </div>
                          </p:outputPanel>
                          <div style="position: relative;display: inline;float: right;padding-right: 15px;padding-top: 2px;overflow: hidden">
                                  <h:commandButton image="/resources/images/br_flag.png" action="#{i18nService.changeLanguage}" title="#{msg['main_template.button.flag.br']}" style="cursor: pointer;padding-right: 3px"/>
                                  <h:commandButton image="/resources/images/usa_flag.png" action="#{i18nService.changeLanguage}" title="#{msg['main_template.button.flag.usa']}" style="cursor: pointer"/>
                                  <br/>
                                  <h:graphicImage rendered="#{i18nService.currentLanguage == i18nService.LANGUAGE_BRAZILIAN}" style="padding-left: 4px;" library="images" name="selected.png"/>
                                  <h:graphicImage rendered="#{i18nService.currentLanguage == i18nService.LANGUAGE_AMERICAN}" style="padding-left: 31px;" library="images" name="selected.png"/>
                          </div>
          </h:panelGroup>

          

          </h:form>
           <div class="hr_class">
              <hr/>
           </div>
            <p:growl id="messages" showDetail="true"/>
            
        <ui:insert name="content">


        </ui:insert>

         <style type="text/css">

        .even-row{
            background-color: #{themeService.themeProperties.EVEN_ROW} !important;
            background-image: none;
            }
        </style>
        <script type="text/javascript">

        var chartStyle = {
	 padding : 20,
	 border: {color: 0x96acb4, size: 8},
	 legend: {
		 display: "right"
	 }
};


        function handleComplete(args){
            if(args.compatible == -1){
                notSupported.show();
            }
             if(args.compatible == 0){
                notTested.show();
            }
        }

        </script>
    </h:body>

        </f:view>
</html>
